<?php
/**
 * @package     Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$root_path = JURI::root();
$tpath = $root_path.'templates/cnsolution/';

//get data
$name_sub_catSeo = ContentHelperCnsolution::getNameOfSubCat(intval($this->catid_seo));
$data_seo_article = ContentHelperCnsolution::getDataByCatId(intval($this->catid_seo));

?>
<!-- SUBHEADER
================================================== -->
<div id="subheader">
    <div class="row">
        <div class="twelve columns">
            <p>
                SEO WEBSITE
            </p>
        </div>
    </div>
</div>
<div class="hr">
</div>
<!-- CONTENT 
================================================== -->
<div class="row">
    <div class="twelve columns">
        <!-- CATEGORIES-->
        <section id="options" class="clearfix">
        <ul id="filters" class="option-set clearfix" data-option-key="filter">
            <li><a href="#filter" data-option-value="*" class="portofoliobutton selected">Show all</a></li>
            <?php foreach($name_sub_catSeo as $value): ?>
                <li><a href="#filter" data-option-value=".<?php echo strtolower($value->title); ?>" class="portofoliobutton">
                        <?php echo ucfirst(strtolower($value->title));?></a>
                </li>
            <?php endforeach; ?>   
        </ul>
        </section>
    </div>
</div>
<div class="row">
    <div id="portofolio">
        <?php foreach($data_seo_article as $value):?>
            <div class="three columns category
                <?php echo strtolower(ContentHelperCnsolution::getNameOfCatFromCatID(intval($value->catid)) ); ?>">
                <h5><?php echo strtoupper($value->title); ?></h5>
                <p>
                    <?php echo ContentHelperCnsolution::truncateDataFilter($value->content,20); ?> 
                </p>
                <div class="portofoliothumb">
                    <?php
                        //data small image
                        $value_img_obj = json_decode($value->images);
                        $thumb_image['link_image'] = $value_img_obj->image_intro;
                        $thumb_image['alt']  = $value_img_obj->image_intro_alt;
                        $thumb_image['caption']  = $value_img_obj->image_intro_caption;

                        //get link article
                        $slug = $value->alias ? ($value->id . ':' . $value->alias) : $value->id;
                        $links_article = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $value->catid, $value->language));
                     ?>
                    <div class="portofoliothumboverlay threeoverlay">
                        <div class="viewgallery threegallery">
                            <a data-gal="prettyPhoto[gallery]" href="<?php echo $thumb_image['link_image']; ?>">
                            <img src="<?php echo $tpath;?>images/playgal.png" class="left galleryicon" alt=""> Gallery </a>
                        </div>
                        <div class="inner threedetail">
                            <a class="projectdetail" href="<?php echo $links_article; ?>">+ Project Details</a>
                        </div>
                    </div>
                        <img src="<?php echo $thumb_image['link_image']; ?>" class="threeimage" alt=""/>
                    </div>
            </div>
        <?php endforeach; ?>
    </div>
</div>
<div class="hr">
</div>
